﻿/* 
   Copyright 2011 LUCA Studios LLC & John Evans

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

namespace LUCAStudios.Silverlight.Controls
{
    using System;
    using System.Windows;
    using DragDrop;

    internal abstract class LUCADropZoneBase : DropZoneBase
    {
        protected const double DropTargetOffset = 5.0;
        protected const double MaxDropTargetSize = 40.0;
        protected const double MinDropTargetSize = 5.0;
        protected const double DropTargetRelativeSize = .10;
        protected const double TargetVisualRelativeSize = .25;
        protected const double DefaultBorderThickness = 3;
        protected const byte TargetVisualTransparancy = 125; // lower is more transparent

        protected LUCADropZoneBase(IDragDropTarget source, Rect dimensions, Thickness dropZoneOffsets) : base(source, dimensions, dropZoneOffsets) { }

        /// <summary>
        /// Helper method to adjust a given size to within boundary limits.
        /// </summary>
        /// <param name="size"></param>
        /// <returns></returns>
        protected static double AdjustedTargetSize(double size)
        {
            return Math.Max(Math.Min(size, MaxDropTargetSize), MinDropTargetSize);
        }

        //TODO: Convert to enum
        internal string DropZoneAction { get; set; }

        //transport mechanism
        internal object Data { get; set; }

        protected override void OnDropZoneEntered()
        {

        }

        protected override void OnDropZoneLeave()
        {

        }

        protected override void OnDropZoneDropped()
        {

        }
    }
}
